package com.baosight.risk.mapper.rire;

import com.baosight.risk.base.mapper.BaseMapper;
import com.baosight.risk.service.rire.entity.RireRiskTarget;
import com.baosight.risk.service.zbaa.entity.ZbaaTarget;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RireRiskTargetMapper extends BaseMapper<RireRiskTarget> {

    /**
     * 根据重点风险查询所有风险指标
     *
     * @param importReportGuid
     * @return
     */
    List<RireRiskTarget> getTargetByImportId(@Param("importReportGuid") String importReportGuid);

    /**
     * 根据重点风险删除所有风险指标
     *
     * @param importReportGuid
     * @return
     */
    Integer deleteByImportId(@Param("importReportGuid") String importReportGuid);


    /**
     * 根据重点风险找到所有【关键】风险指标
     *
     * @param importReportGuid
     * @return
     */
    List<RireRiskTarget> getKeyTarget(@Param("importReportGuid") String importReportGuid);

    List<RireRiskTarget> getByReportIdAndTargetNo(@Param("importReportGuid") String importReportGuid,
                                                  @Param("compCode") String compCode,
                                                  @Param("targetNo") String targetNo);

    /**
     * 根据年度重点风险找到披露报告重的符合条件的指标
     *
     * @param acctYear   年度
     * @param compCode   组织结构
     * @param targetType 指标类型
     * @return
     */
    List<ZbaaTarget> getTargetByImport(@Param("acctYear") String acctYear,
                                       @Param("compCode") String compCode,
                                       @Param("targetType") String targetType);



    /**
     * 查询Ext2 为空的先行指标数据 (为发送过的数据)
     * @param rireRiskTarget
     * @return
     */
    List<RireRiskTarget> selectUnsentCount(@Param("target") RireRiskTarget rireRiskTarget);

    List<RireRiskTarget> getHistory(@Param("targetId")String targetNo,@Param("count") int i);

    List<RireRiskTarget> getLastZbaaTargetInfo(@Param("targetNo")String s, @Param("limitCount")String s1);
}